using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class admin_webparts_Plug_in_PlugInManager : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            string action = Request.QueryString["action"];
            string controlName = null;
            if (action != null)
            {
                if (action.Equals("list", StringComparison.OrdinalIgnoreCase))
                {
                    controlName = "PlugInList.ascx";
                }
                else if (action.Equals("add", StringComparison.OrdinalIgnoreCase))
                {
                    controlName = "PlugInInput.ascx";
                }
                else if (action.Equals("edit", StringComparison.OrdinalIgnoreCase))
                {
                    controlName = "PlugInInput.ascx";
                }
                else if (action.Equals("del", StringComparison.OrdinalIgnoreCase))
                {
                    Response.Redirect("?type=plug_in&action=list");
                }
                else
                {
                    controlName = "PlugInList.ascx";
                }
            }
            else
            {
                controlName = "PlugInList.ascx";
            }

            if (controlName != null)
            {
                Control ctrl = LoadControl(controlName);
                this.Controls.Add(ctrl);
            }
        }
        catch (Exception) { };
    }
}
